import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        int len = str.length();
        char s[] = str.toCharArray();
        int count = 0;
        for (int i = 0; i < len; i++) {
            if (s[i] != ' ')
                count++;
        }
        System.out.println(count);
    }
}
